


    import * as React from 'react';
    import * as ReactDOM from 'react-dom';


    var $input = require("./input.js");
    var INPUT = $input.INPUT;
    /*input label插件*/
    var INPUT_LABEL = $input.INPUT_LABEL;
    /*textarea插件*/
    var TEXTAREA = $input.TEXTAREA;
    /*验证插件*/
    var VALIDE = require("./valide.js").VALIDE;
    var SELECT = require("./select.js").SELECT;

    var UPIMGAE = require("./upiamge.js").UPIMGAE;


    var IN = React.createClass({
        getDefaultProps: function () {
            return {
                type: 'INPUT', title: "大哥你先设置个title", isStar: false, cssLength: 1,
                css: {
                    0: "",
                    1: "one",
                    2: "two",
                    3: "three",
                    4: "four"
                }
            };
        },
        componentWillMount: function () {
            this.setFormValue(this.props.param.defaultValue ? this.props.param.defaultValue : "");
        },
        handleBlur: function (value) {

            //console.log("进入验证方法" + value);
            var param = this.props.param, vaMessage = "", temp = {};
            if (value == "" && param.isStar) {
                param.errorMessage = "不能为空!";
            } else if (param.vaMethod) {
                vaMessage = param.vaMethod(value);
                param.errorMessage = vaMessage;
            } else {
                param.errorMessage = true;
            }
            temp[this.props.param.name] = param;
            this.props.changState(temp);
        },
        setFormValue: function (item) {
            var data = this.props.getState("data");

            data[item.name] = item.value;
            this.props.changState({
                "data": data
            })
            //console.log("表单数据:" + JSON.stringify(data));
        },
        render: function () {

            var cssLength = "from-in-area " + this.props.css[this.props.param.csslength];
            var defaultValue = this.props.param.defaultValue ? this.props.param.defaultValue : "";
            return (
             
            )
        }

    })
    module.exports =  {
        IN: IN,
    }
